#ifndef SYNC_ALG_H
#define SYNC_ALG_H

#include <ImageType.hpp>
#include <cstdint>
#include <functional>
#include <atomic>

class SyncAlg
{
  public:
    SyncAlg(int cameraNumber);
    virtual ~SyncAlg();
    void setResultCallback(std::function<void(const std::vector<ImageType>&)>);
    bool InputImage(ImageType& image,int camera_index);  //输入图像，算法会接管该对象所有权
  private:
    std::function<void(const std::vector<ImageType>&)> funcResult;
    std::vector<ImageType> ImageList;
    std::atomic_int syncCount=0;
    std::atomic_int syncFrameID=0;
    int cameraNum;
};

#endif

